<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/jiazai.css" />
		<link rel="stylesheet" type="text/css" href="css/index.css" />
		<style type="text/css">
			#user-wallet {
				background: url(img/index-bg.png) no-repeat center center;
				background-size: 100% 100%;
			}
		</style>
	</head>

	<body>
		<div id="app">
			<!-- 加载中动画 -->
			<div id='jiazai-ani' v-if='jiazai'>
				<div class="arc"></div>
				<h1><span>LOADING</span></h1>
			</div>
			<!-- 加载中动画 -->

			<!-- 通知 -->
			<div id='noti-com' class='dis-cen' v-if='noti'>
				<div style='width:75%;'>
					<div class='noti-dom'>
						<img src="img/noti-img.png" style="width:100%;">
					</div>
					<p class='dis-cen' @click='closeNoti'>
						<img src="img/close.png" style="width:35px;height:35px;">
					</p>
				</div>
			</div>
			<!-- 通知 -->

			<div id="user-wallet">
				<div class="dis-spa tit-hea">
					<span style="opacity: 0;">1</span>
					<div class='hea-logo dis-cen'>
						<img src="img/index-tit-img.png" style="width: 100px;height:31px;" />
					</div>
					<div class="tit-notice">
						<span></span>
						<img src="img/notice.svg" style="width:30px;height: 30px;" />
					</div>
				</div>
				<p class="dis-cen all-wa-tit">
					<span @tap="_indexOpenHref({url:'trans-info.html',id:'transInfo'})">总资产</span>
					<img @tap='monShow=!monShow' :src="monShow?'img/eyes-white-open.svg':'img/eyes-white-close.svg'" style="width:22px;height: 22px;" />
				</p>
				<p class='all-hea-mon'>
					<span v-text='monShow?"121":"******"' :style="{'font-size':monShow?'':'25px'}">121321.61</span>
					<span>USD</span>
				</p>
				<p class='all-hea-cny'>
					<span>≈</span>
					<span v-text='monShow?"121":"******"'>218453121</span>
					<span>CNY</span>
				</p>
			</div>
			<div id="coins-list-wrap" class="mui-content mui-scroll-wrapper">
				<div>
					<div class="dis-spa coins-list" v-for="(val,index) in 15" :key='index' @tap="goMon(val)">
						<img src="img/coins.png" style="width:35px;height: 35px;" />
						<div class="coins-info">
							<p class="dis-spa">
								<span>BCC</span>
								<span v-text="monShow?'1233.22':'****'">2.00</span>
							</p>
							<p class="dis-spa">
								<span>Bition</span>
								<span>≈<span v-text="monShow?'1233.22':'****'">66666.52</span>CNY</span>
							</p>
						</div>
					</div>
				</div>
			</div>
		</div>

		<script src="js/comm.js"></script>
		<script src="js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/mui.min.js"></script>
		<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" charset="utf-8">
		
			var app = new Vue({
				el: '#app',
				data: {
					jiazai: false,
					//资产显示/隐藏
					monShow: true,
					//第一次出现的弹窗控制
					noti: {
						tit: '你好',
						con: '世界'
					}
				},
				mounted:function(){
					this.$nextTick(function(){
						var boTime=setInterval(function(){
							var web=plus.webview.getWebviewById('bottom');
							if(web){
								clearInterval(boTime);
								setTimeout(function(){
									plus.webview.getWebviewById('bottom').evalJS('openJia()');
								},250);
							}
						},100);
					});
				},
				methods: {
					//去到币详情
					goMon: function(val) {
						var web = _indexOpenHref({
							url: 'money-info.html',
							id: 'moneyInfo'
						});
					},
					//关闭首页出现的通知
					closeNoti:function(){
						this.noti=false;
						plus.webview.getWebviewById('bottom').evalJS('closeJia()');
					}
				}
			});
			mui.init({
				pullRefresh: {
					container: '#app',
					down: {
						style: 'circle',
						callback: function() {
							mui('#app').pullRefresh().endPulldown();
						}
					},
					up: {

					}
				}
			});

			mui.plusReady(function() {
				//				localStorage.setItem('kui_user','');
				var kui = localStorage.getItem('kui_user');
				if(!kui) {
					var cre = plus.webview.create('create-wallet.html', 'createWallet', {
						statusbar: {
							background: '#ffffff'
						}
					});
					cre.show('none');
					setTimeout(function() {
						cre.evalJS("close()");
					}, 300);
					return;
				}

				var op = {
					top: 0,
					left: 0,
					right: 0,
					bottom: '60px',
					statusbar: {
						background: '#fff'
					},
				};

				var current = plus.webview.getWebviewById('index') || plus.webview.getLaunchWebview();
				current.setStyle({
					top: 0,
					left: 0,
					right: 0,
					bottom: '60px',
					statusbar: {
						background: '#2471ff'
					}
				});

				plus.webview.create('bottom.html', 'bottom', {
					bottom: 0,
					left: 0,
					right: 0,
					height: '60px',
				}).show();
				plus.webview.create('index1.html', 'index1', op);
				plus.webview.create('index2.html', 'index2', op);
				plus.webview.create('index3.html', 'index3', op);
				plus.webview.create('index4.html', 'index4', op);

			});
			var closeOth = function() {
				mui.plusReady(function() {
					var all = plus.webview.all();
					setTimeout(function() {
						for(var i = 0; i < all.length; i++) {
							if(all[i].id.toLowerCase() != 'hbuilder' && all[i].id != 'bottom' && all[i].id != 'index1' && all[i].id != 'index2' && all[i].id != 'index3' && all[i].id != 'index4' && all[i].id != 'index') {
								all[i].hide();
							}
						}
					}, 4000);
					setTimeout(function() {
						for(var i = 0; i < all.length; i++) {
							if(all[i].id.toLowerCase() != 'hbuilder' && all[i].id != 'bottom' && all[i].id != 'index1' && all[i].id != 'index2' && all[i].id != 'index3' && all[i].id != 'index4' && all[i].id != 'index') {
								all[i].close('none');
							}
						}
					}, 7000);
				});
			};
			var first = null;
			mui.back = function() {
				//首次按键，提示‘再按一次退出应用’
				if(!first) {
					first = new Date().getTime();
					plus.nativeUI.toast("再按一次退出程序");
					setTimeout(function() {
						first = null;
					}, 1000);
				} else {
					if(new Date().getTime() - first < 1000) {
						plus.runtime.quit();
					}
				}
			};
		</script>
	</body>

</html>